/*
 * Copyright (C) 2013 Daniel Wasilew <daniel.wasilew@codeminer.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.codeminer.parts.library;

import java.io.Serializable;

/**
 *
 * @author Daniel Wasilew <daniel.wasilew@codeminer.org>
 */
public class DefaultIdentifiable implements Serializable, Identifiable {
    private long oid = -1;

    public DefaultIdentifiable(long oid) {
        this.oid = oid;
    }

    public DefaultIdentifiable() {
    }
    
    @Override
    public long getOid() {
        return oid;
    }

    @Override
    public void setOid(long oid) {
        this.oid = oid;
    }

    @Override
    public final boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DefaultIdentifiable other = (DefaultIdentifiable) obj;
        if (this.oid != other.oid) {
            return false;
        }
        return true;
    }

    @Override
    public final int hashCode() {
        int hash = 3;
        hash = 17 * hash + (int) (this.oid ^ (this.oid >>> 32));
        return hash;
    }
    
        
}
